function enqueue (element) {
  this.dataStore.push(element)
}

function dequeue () {
  return this.dataStore.shift()
}

function front () {
  return this.dataStore[0]
}

function back () {
  return this.dataStore[this.dataStore.length - 1]
}

function tostring () {
  this.dataStore.forEach(item => {
    console.log(item)
  })
}

function empty () {
  return this.dataStore.length === 0 ? true : false
}

function Queue () {
  this.dataStore = []
  this.enqueue = enqueue
  this.dequeue = dequeue
  this.front = front
  this.back = back
  this.tostring = tostring
  this.empty = empty
}

const q = new Queue()
q.enqueue("Meredith")
q.enqueue("Cynthia")
q.enqueue("Jennifer")
q.tostring()
q.dequeue()
q.tostring()
console.log("Front of queue: " + q.front())
console.log("Back of queue: " + q.back())